import axios from '@/libs/api.request'

// 供应商列表
export const supplierList = (data) => {
  return axios.request({
    url: '/supplier/list',
    method: 'post',
    data: data
  })
}

// 供应商新增
export const supplierAdd = (data) => {
  return axios.request({
    url: '/supplier/create',
    method: 'post',
    data: data
  })
}

// 供应商编辑
export const supplierEdit = (data) => {
  return axios.request({
    url: '/supplier/update',
    method: 'post',
    data: data
  })
}

// 供应商详情
export const supplierDetail = (data) => {
  return axios.request({
    url: '/supplier/get',
    method: 'post',
    data: data
  })
}

// 供应商详情 -- 商品信息
export const supplierProductList = (data) => {
  return axios.request({
    url: '/inventory/goods/list',
    method: 'post',
    data: data
  })
}

// 供应商详情 -- 日志
export const supplierLog = (data) => {
  return axios.request({
    url: '/supplier/operation/logs',
    method: 'post',
    data: data
  })
}

// 仓库列表
export const entrepotList = (data) => {
  return axios.request({
    url: '/inventory/purchase/warehouse/list',
    method: 'post',
    data: data
  })
}

// 仓库新增
export const entrepotAdd = (data) => {
  return axios.request({
    url: '/inventory/purchase/warehouse/create',
    method: 'post',
    data: data
  })
}

// 仓库编辑
export const entrepotEdit = (data) => {
  return axios.request({
    url: '/inventory/purchase/warehouse/update',
    method: 'post',
    data: data
  })
}

// 仓库详情
export const entrepotDetail = (data) => {
  return axios.request({
    url: '/inventory/purchase/warehouse/get',
    method: 'post',
    data: data
  })
}

// 机台列表
export const getMachineList = (data) => {
  return axios.request({
    url: '/machine/product/list',
    method: 'post',
    data: data
  })
}

// 机台详情
export const machineDetail = (data) => {
  return axios.request({
    url: '/machine/product/query',
    method: 'post',
    data: data
  })
}

// 机台编辑
export const machineEdit = (data) => {
  return axios.request({
    url: '/machine/product/save',
    method: 'post',
    data: data
  })
}

// 采购列表查询商品
export const inventoryGoodsList = (data) => {
  return axios.request({
    url: '/inventory/goods/list',
    method: 'post',
    data: data
  })
}

// 采购列表查询
export const inventoryCategoryList = (data) => {
  return axios.request({
    url: '/inventory/category/list',
    method: 'post',
    data: data
  })
}

// 采购商品详情
export const inventoryGoodsGet = (data) => {
  return axios.request({
    url: '/inventory/goods/get',
    method: 'post',
    data: data
  })
}

// 采购创建商品
export const inventoryGoodsCreate = (data) => {
  return axios.request({
    url: '/inventory/goods/create',
    method: 'post',
    data: data
  })
}

// 采购商品冻结
export const inventoryGoodsFreeze = (data) => {
  return axios.request({
    url: '/inventory/goods/freeze',
    method: 'post',
    data: data
  })
}

// 查询供应商列表不分页
export const supplierNopage = (data) => {
  return axios.request({
    url: '/supplier/list/nopage',
    method: 'post',
    data: data
  })
}

// 采购列表查询商品变更日志
export const inventoryLog = (data) => {
  return axios.request({
    url: '/inventory/goods/log/list',
    method: 'post',
    data: data
  })
}

//  机台列表查询
export const machineList = name => {
  return axios.request({
    url: '/machine/list' + '?name=' + `${name}`,
    method: 'get'
  })
}

//  采购商品条码
export const inventoryGoodsBar = (data) => {
  return axios.request({
    url: '/inventory/goods/barcode',
    method: 'post',
    data: data
  })
}

// 根据组织查询对应分组标签
export const getOrgTag = (data) => {
  return axios.request({
    url: '/oms/merchant/org/tags',
    method: 'post',
    data: data
  })
}

// 采购编辑商品
export const inventoryGoodsEdit = (data) => {
  return axios.request({
    url: '/inventory/goods/edit',
    method: 'post',
    data: data
  })
}

// 商品分类列表
export const getCategoryList = data => axios.request({
  url: '/inventory/category/list',
  method: 'post',
  data
})
// 商品分类新增
export const createCategory = data => axios.request({
  url: '/inventory/category/create',
  method: 'post',
  data
})
// 商品分类删除
export const deleteCategory = data => axios.request({
  url: '/inventory/category/delete',
  method: 'post',
  data
})
// 商品分类编辑
export const updateCategory = data => axios.request({
  url: '/inventory/category/edit',
  method: 'post',
  data
})
// 商品分类转移
export const transferCategory = data => axios.request({
  url: '/inventory/category/goods/migrate',
  method: 'post',
  data
})
//  根据组织查询对应分组标签
export const getOrgTagList = data => axios.request({
  url: '/oms/merchant/org/tags',
  method: 'post',
  data
})
